<?php /*a:2:{s:83:"D:\laragon\www\jiaqueshop\application\manage\view\business_member_distribution.html";i:1598341993;s:59:"D:\laragon\www\jiaqueshop\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<script src="/static/public/My97DatePicker/WdatePicker.js"></script>
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>系统</span>
            <span class="icon-angle-right"></span>
            <span>分销管理</span>
            <span class="icon-angle-right"></span>
            <span>用户分配</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" action="">
                    <table class="m-table">
                        <thead>
                        <tr>
                            <th colspan="2">用户分配</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td width="15%"><label for="title">用户名称<em>*</em></label></td>
                            <td width="50%"><?php echo htmlentities($memberData['nickname']); ?></td>

                        </tr>
                        <tr>
                            <td><label for="">选择商家<em>*</em></label></td>
                            <td>
                                <div class="lay-select">
                                    <select name="business_id">
                                        <option value="0">请选择商家</option>
                                        <?php if(is_array($businessData) || $businessData instanceof \think\Collection || $businessData instanceof \think\Paginator): if( count($businessData)==0 ) : echo "" ;else: foreach($businessData as $key=>$v): ?>
                                            <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['business_name']); ?></option>
                                        <?php endforeach; endif; else: echo "" ;endif; ?>
                                    </select>
                                </div>
                            </td>
                        </tr>

                    </table>
                    <div class="m-form-btn"><input type="hidden" name="member_id" value="<?php echo htmlentities($memberData['id']); ?>"><button lay-submit lay-filter="formDemo" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form,
            layer = layui.layer;

        //监听提交
        form.on('submit(formDemo)', function(data){
            var business_id = data.field.business_id;
            var member_id = data.field.member_id;
            if (business_id == '0'){
                layer.alert("请选择商家");
                return false;
            }
            $.post('/manage/business/saveDistribution',{
                business_id :business_id,
                member_id:member_id
            },function (res) {
                if (res.status){
                    layer.alert(res.message);
                }else{
                    layer.alert(res.message,function (index) {
                        layer.close(index);
                        window.location.href='/manage/business/memberDistribution'
                    });
                }
            });
            return false;
        });
    });
</script>

</body>
</html>